import {createSlice,createAsyncThunk} from '@reduxjs/toolkit';
import { getInterviewTitle } from '../api/interview';

//aaa paifa
export const getInterviewTitleAsync = createAsyncThunk(
    'interview/getInterviewTitleAsync',
    async(_,thunkApi)=>{
      const {data} = await getInterviewTitle();
    //   console.log(data,'08'); 
      //ddd
      thunkApi.dispatch(initInterviewTitleList(data))
    }
    )
const interviewSlice = createSlice({
    name: 'interview',
    initialState: {
        interviewTitleList: [],
    },
    reducers:{
        //eee payload 接收
        initInterviewTitleList: (state, {payload}) => {
            state.interviewTitleList = payload;
        }
    }
})

const {initInterviewTitleList} = interviewSlice.actions;
export default interviewSlice.reducer;  